﻿using CefSharp;
using CefSharp.Wpf;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace FJWebBrowser
{
    /// <summary>
    /// UserControl_ChromeWebBrowser.xaml 的交互逻辑
    /// </summary>
    public partial class UserControl_ChromeWebBrowser : UserControl
    {
        public UserControl_ChromeWebBrowser()
        {
            InitializeComponent();
        }
        public void Start(string url)
        {
            InitBrowser(url);
        }
        public ChromiumWebBrowser browser;
        private void InitBrowser(string url)
        {
            var settings = new CefSettings
            {

            };
            settings.CefCommandLineArgs.Add("ppapi-flash-path", System.AppDomain.CurrentDomain.BaseDirectory + "plugins\\pepflashplayer32_30_0_0_134.dll");
            settings.CefCommandLineArgs.Add("ppapi-flash-version", "30.0.0.134");
            Cef.Initialize(settings);
            browser = new ChromiumWebBrowser();
            browser.Address = url;
            this.broad.Children.Insert(0, browser);

        }
    }
}
